home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / programm.ing / patch.arc / ATARIST.C next >
Encoding:
C/C++ Source or Header  |  1988-07-23  |  1.7 KB  |  113 lines

  1.  
  2. /* random atari funs */
  3.  
  4. #include <stdio.h>
  5. #include <file.h>
  6. #include <osbind.h>
  7.  
  8. long _stksize = 32768;
  9.  
  10. int creat(name, crapola)
  11. char * name;
  12. int crapola;
  13. {
  14.   return(open(name, O_WRONLY | O_CREAT | O_TRUNC, 0));
  15. }
  16.  
  17. int system(str)
  18. char * str;
  19. {
  20.   fprintf (stderr, " system('%s')\n", str);
  21.   return (-1);
  22. }
  23.  
  24. setbuf(f, b)
  25. FILE * f;
  26. char * b;
  27. {
  28. /* more stupidity */
  29. }
  30.  
  31. int chdir(dir)
  32. char * dir;
  33. {
  34.   return(Dsetpath(dir));
  35. }
  36.  
  37. _eprintf(str, a1, a2, a3, a4, a5, a6)
  38. char * str;
  39. int a1, a2, a3, a4, a5, a6;
  40. {
  41.   fprintf(stderr, str, a1, a2, a3, a4, a5, a6);
  42. }
  43.  
  44. int link(foo, bar)
  45. char * foo, * bar;
  46. {
  47. /* I think the best we can do here is rename... */
  48.   return(Frename(0, foo, bar));
  49. }
  50.  
  51. int chmod(name, stupidity)
  52. char * name;
  53. int stupidity;
  54. {
  55.   return (0);
  56. }
  57.  
  58. int popen(barfage)
  59. char * barfage;
  60. {
  61.   fprintf(stderr, "popen('%s')\n", barfage);
  62.   return (-1);
  63. }
  64.  
  65. int pclose()
  66. {
  67.   return(0);
  68. }
  69.  
  70. /* debug rtn */
  71. int xxxopen(foo, bar)
  72. char * foo;
  73. int bar;
  74. {
  75.   int result;
  76.  
  77.   fprintf(stderr, "open('%s', %d)->", foo, bar);
  78.   result = open(foo, bar);
  79.   fprintf(stderr, "%d\n", result);
  80.   return(result);
  81. }
  82.  
  83. char * xxxmalloc(nbytes)
  84. int nbytes;
  85. {
  86.   char * result;
  87.  
  88.   fprintf(stderr, "malloc(%d)", nbytes);
  89.   result = (char * )malloc(nbytes + 64);
  90.   fprintf(stderr, "->%X\n", result);
  91.   return(result);
  92. }
  93.  
  94. char * xxxrealloc(p, nbytes)
  95. char * p;
  96. int nbytes;
  97. {
  98.   char * result;
  99.  
  100.   fprintf(stderr, "realloc(%X, %d)", p, nbytes);
  101.   result = (char * )realloc(nbytes + 64);
  102.   fprintf(stderr, "->%X\n", result);
  103.   return(result);
  104. }
  105.  
  106. xxxfree(p)
  107. char * p;
  108. {
  109.   fprintf(stderr, "free(%X)\n", p);
  110.   free(p);
  111. }
  112.  
  113.